<style scoped>
  @import "banner.css";
</style>
<template>
  <van-swipe v-if="list.length>0" class="swipe" :autoplay="autoplay" indicator-color="white">
    <van-swipe-item @click.native="jump(index)" class="item" v-for="(item, index) in list" :key="index">
      <van-image :src="GLOBAL.getUrl(item.img!=null?item.img[0]:item.oriimg[0])" lazy-load></van-image>
    </van-swipe-item>
  </van-swipe>
</template>
<script>
  import {actionDis} from "../../../libs/action-tools";
  import Vue from 'vue';
  import {Swipe, SwipeItem, Image} from 'vant';

  Vue.use(Image).use(Swipe).use(SwipeItem);
  export default {
    name: 'qbanner',
    props: {
      list: {
        type: Array,
        default: function () {
          return [];
        }
      },
      autoplay: {
        type: Number, default: 3000
      }
    },
    data() {
      return {}
    },

    methods: {
      jump(index) {
        actionDis(this.list[index], this)
      }
    }
  }
</script>
